

int main()
{

	return 0;
}

struct ListNode* removeElements(struct ListNode* head, int val) {
    struct ListNode* cur = head;
    struct ListNode* ptre = NULL;
    while (cur)
    {
        if (cur->val != val)
        {
            ptre = cur;
            cur = cur->next;
        }
        else
        {
            if (ptre == NULL)
            {
                head = cur->next;
                free(cur);
                cur = head;
            }
            else
            {
                ptre->next = cur->next;
                free(cur);
                cur = ptre->next;
            }

        }
    }
    return head;
}